package com.stone.business.workcard.action;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.stone.business.workcard.pojo.MainWorkCardOne;
import com.stone.business.workcard.service.WorkcardService;
import com.stone.para.IConstant;
import com.stone.utils.StringUtils;

import frm.ssh.action.BaseListAction;
/**
 * 班组作业控制卡（二种票）查询Action
 * @author Administrator
 *
 */
public class WorkcardTwoListAction extends BaseListAction{
	private WorkcardService workcardService;
	@Override
	public HashMap<String, Object> setSearchCondition() {
		HashMap<String, Object> m = new HashMap<String, Object>();
		
		List<Object> valsList = new ArrayList<Object>();
		
		m.put("cols", " a ");
		
		String conditions = " oc_type='02' ";//二种票  
		
		/*if (!"1".equals(this.getSessionAttribute(IConstant.SESSION_ISADMIN))) {
			conditions += " AND a.ouid = '" + super.getSession().getAttribute(IConstant.SESSION_TORGAN_CODE) + "'";
		}*/
		
		if (!StringUtils.isNullOrBlankFull(super.getSearchBean().getCon2())) {
			conditions += " AND TO_CHAR(a.dt_czrq,'yyyy-MM-dd') >= ?";
			valsList.add(super.getSearchBean().getCon2());
		}
		
		if (!StringUtils.isNullOrBlankFull(super.getSearchBean().getCon3())) {
			conditions += " AND TO_CHAR(a.dt_czrq,'yyyy-MM-dd') <= ?";
			valsList.add(super.getSearchBean().getCon3());
		}
		
		/*if (!StringUtils.isNullOrBlankFull(super.getSearchBean().getCon3())) {
			conditions += " AND userid like ?";
			valsList.add("%" + super.getSearchBean().getCon3() + "%");
		}*/
		
		// 查询条件
		m.put("conditions",conditions);
		m.put("clause", " order by a.id_sno Desc");
		m.put("alias", " a ");
		m.put("vals", valsList.toArray());
		
		return m;
	}
	public WorkcardService getWorkcardService() {
		return workcardService;
	}
	public void setWorkcardService(WorkcardService workcardService) {
		this.workcardService = workcardService;
		this.service=workcardService;
	}
	public WorkcardTwoListAction() {
		this.entityClass = MainWorkCardOne.class;
	}
	

}
